#ifndef _UI_HOMEPAGE_H
#define _UI_HOMEPAGE_H

#ifdef __cplusplus
extern "C" {
#endif

#include "../../ui.h"

#define COLOR_CHING 0xff00e3e3
#define COLOR_WHITE 0xffffffff
#define COLOR_BLACK 0xff000000 // 0xff000000
#define COLOR_RED 0xffff0000   // 0xff28be72
#define COLOR_GREEN 0xff00ff00 // 0xff28be72
#define COLOR_BLUE 0xff0000ff  // 0xff28be72
#define UI_RESOURCE_PATH                                        "/oem/hir_res/ui_Z/"

enum xt_key_event{
    XT_KEY_EVENT_INVALID = 0,
    XT_KEY_EVENT_POWER,//电源
    XT_KEY_EVENT_BRIGHT,//亮度
    XT_KEY_EVENT_DIM,//亮度调暗
    XT_KEY_EVENT_PSEUDE_COLOR,//伪彩 false color, PALETTE
    XT_KEY_EVENT_ZOOM,//放大
    XT_KEY_EVENT_REDUCE,//缩小
    XT_KEY_EVENT_PHOTO,//拍照/录像
    XT_KEY_EVENT_VIDEO,//拍照/录像
    XT_KEY_EVENT_MENU,//菜单
    XT_KEY_EVENT_LASER,//测距
    XT_KEY_EVENT_LASER_LONG,// 8 测距模式切换
    XT_KEY_EVENT_PIP,//picture in picture, 画中画
    XT_KEY_EVENT_SHUTTER_RELEASE,//打快门
    XT_KEY_EVENT_SHUTTER_BRUSH,//刷快门，闭合-打开
    XT_KEY_EVENT_MAX,//伪彩-测距
    XT_KEY_EVENT_ENTER,//进入菜单
    XT_KEY_EVENT_EXIST,//退出菜单
    XT_KEY_EVENT_UP,//按向上键
    XT_KEY_EVENT_DOWN,//16 下键
    XT_KEY_EVENT_LEFT,//左键
    XT_KEY_EVENT_RIGHT,//右键
    XT_KEY_EVENT_TURN_UP,//上旋
    XT_KEY_EVENT_TURN_DOWN,//下旋
    XT_KEY_EVENT_TURN_LEFT,//左旋
    XT_KEY_EVENT_TURN_RIGHT,//22 右旋
    XT_KEY_EVENT_THEME_HID,//主题隐藏
    XT_KEY_EVENT_DEL,//删除
    XT_KEY_EVENT_NULL,//不操作
};

enum xt_bat_status{
    XT_BAT_STATUS_LOADING = 0,//
    XT_BAT_STATUS_CHARGE,
    XT_BAT_STATUS_EMPTY,
    XT_BAT_STATUS_0,
    XT_BAT_STATUS_1,
    XT_BAT_STATUS_2,
    XT_BAT_STATUS_3,
    XT_BAT_STATUS_4,
    XT_BAT_STATUS_MAX,
};

enum xt_sd_status{
    XT_SD_STATUS_DISKUSB = 0,//
    XT_SD_STATUS_DISKFORBID,
    XT_SD_STATUS_MAX,
};

enum xt_zoom_status{
    XT_ZOOM_STATUS_BASE = 0,//
    XT_ZOOM_STATUS_MAX,
};

extern lv_ft_info_t ttf_info_12;
extern lv_ft_info_t ttf_info_16;
extern lv_ft_info_t ttf_info_20;
extern lv_ft_info_t ttf_info_24;
extern lv_ft_info_t ttf_info_28;
extern lv_ft_info_t ttf_info_32;
extern lv_ft_info_t ttf_info_34;
extern lv_ft_info_t ttf_info_36;
extern lv_ft_info_t ttf_info_40;
extern lv_ft_info_t ttf_info_44;
extern lv_ft_info_t ttf_info_48;
extern lv_ft_info_t ttf_info_56;

extern lv_obj_t * ui_HomePage;
extern lv_obj_t * ui_TimeHourLabel;
extern lv_obj_t * ui_TimeColonLabel;
extern lv_obj_t * ui_TimeMinuteLabel;
extern lv_obj_t * ui_BatArc;
extern lv_obj_t * ui_BaticonLabel;
extern lv_obj_t * ui_BatNumLabel;
extern lv_obj_t * ui_DateLabel;
extern lv_obj_t * ui_DayLabel;
extern lv_obj_t * ui_StepiconLabel;
extern lv_obj_t * ui_StepCnLabel;
extern lv_obj_t * ui_StepNumLabel;
extern lv_obj_t * ui_StepNumBar;
extern lv_obj_t * ui_TempArc;
extern lv_obj_t * ui_TempiconLabel;
extern lv_obj_t * ui_TempNumLabel;
extern lv_obj_t * ui_HumiiconLabel;
extern lv_obj_t * ui_HumiArc;
extern lv_obj_t * ui_HumiNumLabel;
extern lv_obj_t * ui_HRiconLabel;
extern lv_obj_t * ui_HRSpinner;
extern lv_obj_t * ui_HRNumLabel;

extern lv_obj_t * ui_DropDownPanel;
extern lv_obj_t * ui_UpBGPanel;
extern lv_obj_t * ui_NFCButton;
extern lv_obj_t * ui_NFCLabel;
extern lv_obj_t * ui_BLEButton;
extern lv_obj_t * ui_BLELabel;
extern lv_obj_t * ui_PowerButton;
extern lv_obj_t * ui_PowerLabel;
extern lv_obj_t * ui_SetButton;
extern lv_obj_t * ui_SetLabel;
extern lv_obj_t * ui_LightSlider;
extern lv_obj_t * ui_LightLabel;
extern lv_obj_t * ui_DownBGPanel;

extern uint8_t ui_TimeHourValue;
extern uint8_t ui_TimeMinuteValue;
extern uint8_t ui_DateMonthValue;
extern uint8_t ui_DateDayValue;
extern uint8_t ui_DataWeekdayValue;
extern const char * ui_Days[7];

extern uint8_t ui_BatArcValue;
extern uint16_t ui_StepNumValue;
extern uint8_t ui_LightSliderValue;

extern Page_t Page_Home;

void ui_event_HomePage_DropDownPanel(lv_event_t * e);
void ui_event_NFCButton(lv_event_t * e);
void ui_event_BLEButton(lv_event_t * e);
void ui_event_PowerButton(lv_event_t * e);
void ui_event_SetButton(lv_event_t * e);

void ui_HomePage_screen_init(void);
void ui_PowerPage_screen_init(void);

void ui_HomePage_screen_deinit(void);
void ui_PowerPage_screen_deinit(void);
lv_img_dsc_t *load_image_resource(char *res_path);

#ifdef __cplusplus
} /*extern "C"*/
#endif

#endif
